Computer graphics are used in various fields, such as animation, computer games, etc. An important goal of computer graphics is the ability to generate virtual images that are realistic, i.e. similar to naturally occurring images. A major impediment to reaching this goal is the inherent computational limitations of existing computer systems.
More specifically, lighting continues to pose challenges in the field of computer graphics. Naturally, light is an important factor in how one perceives an image. An observer (e.g., a human eye or a camera) perceives an object by detecting light reflected from that object (in other cases the light may be passing through the object or be refracted by the object instead). The light detected from an object may be classified in two types. Direct light is light that travels directly from a light source to the object and to the observer. Indirect light is light that does not travel directly from a light source to the object. For example, indirect light may be light that is reflected from another object before it reaches the object being observed. Alternatively, indirect light may be light that goes through a translucent object before reaching the object being observed.
In the real world, much of the light that we use to perceive the world around us is indirect light. Thus, we can usually see objects that are not directly exposed to a particular light source. For example, in a bright day, a room with a window is usually well-illuminated even if the sun does not directly shine through the window, because the sun's rays reflect from the surrounding scenery and pass through the window, thus illuminating the room.
Considering the above, a perfect computer graphics system would be able to track indirect light to ensure realistic illumination of objects. Unfortunately, for most situations, such a system would be impractical as it would require a very large amount of computing resources. In order to account of indirect light, one has to trace each light ray (or electron) from a light source and off of all objects from which it reflects (this is sometimes referred to as ray tracing). Considering the incredibly large number of light rays illuminating a scene, and the complex paths each light ray may take when being reflected of various objects in a scene, this is not practical.
For the above reasons, many current computer graphics systems are direct light systems. In other words, they usually only take into account light going directly from a light source to an observed object when calculating how that object should be displayed. While using a direct light system significantly reduces computational costs, these systems may, in certain situations, create images that are very unrealistic.
For example, in a direct light system, an object is either directly illuminated by a light or it is not illuminated by that light at all. Thus, for example, if there is only one light source in a scene and a first object is in the shadow of a second object, the first object will usually receive no light in a direct illumination computer graphics scheme. Therefore, the first object will be rendered as being completely dark. This, however, is usually not realistic. In the real world, objects in shadows usually receive some indirect light. Therefore, in the real world, shadows are usually soft. In other words, while shadows receive a lesser amount of light than directly illuminated spaces, they nevertheless do receive some light. Consequently, computer generated images following direct illumination schemes often look unrealistic because they have very stark and harsh shadows.
There have been several attempts to solve the above problem. One is to manually change the color of objects in the shadows to make shadows look softer. This solution is not considered desirable as it requires significant amount of human intervention and thus negates one of the intended benefits of computer graphics—the ability to partially or completely automate the generation of images. Requiring an artist to manually adjust the shadows of computer generated graphics can be very expensive and is often impractical.
Another attempt to solve the above problem is to define additional light sources to illuminate shadowed regions. These additional light sources are usually not associated with an actual light emitting object that is visible in the scene (such as a lamp). Instead, they are intended to approximate the effects of indirect light. This method suffers from the fact that the additional light sources may also illuminate non-shadowed regions, thus decreasing the realism of some parts of the image in order to improve the realism of the shadowed portions.
Another scheme is to use techniques similar to anti-aliasing in order to “smooth over” the edges of shadows. Thus, for example, when determining whether a given pixel is lit, the illumination received by the given pixel may be averaged with illumination levels of a number of pixels in proximity to the given pixel. This would result in more gradual or smooth changes of illumination levels. While this scheme does provide some minor improvement, it does not solve the problem discussed above as the problem is not limited to the edges of shadows. In other words, in direct lighting schemes, the entire shadow, not its edges only, receives unrealistically low illumination. Therefore, even if this technique is used, the non-edge regions of shadows will still be unrealistically dark.
What is needed is a system and method for shading shadowed regions in a computer graphics generated scene that approximates the indirect light effect on shadows in the context of a direct illumination model.